{{useCss "/app-pages/css/admin/module.scss"}}
<div class="module">
    <div class="modulebox">
        <div class="create_new">
            <div class="item">
                <img title="上传图片" bind-src="{{$Cache.admin.module.new.preview_img||'/images/public/39_avatar_small.jpg'}}?imageView2/1/w/48/h/48" onclick="javascript:document.getElementById('upmodulepreview').click()" /> 点击左边上版块块图片（100*100）
                <input style="display: none;" type="file" accept="image/*" name="upload" id="upmodulepreview" event-change="{{'$Event.admin.module.upload_module_preview'}}" />
            </div>
            <div class="item">
                版块名称：
                <input placeholder="请填写版块名称(8字内)" maxlength="8" class="text" type="text" bind-input="{{'$Cache.admin.module.new.name'}}" bind-value="{{$Cache.admin.module.new.name}}" />
            </div>
            <div class="item">
                <button event-click="{{'$Event.admin.module.create_new'}}">创建版块</button>
            </div>
        </div>
        <div class="modules">
            {{#if $Cache.admin.module.module_list.length}}
            <div class="item">
                <div class="preview_img">
                    <img bind-src="/images/public/08_avatar_small.jpg" />
                </div>
                <div class="title">
                    <href to="/admin/module.html">所有</href>
                </div>
            </div>
            {{#each $Cache.admin.module.module_list}}
            <div class="item">
                {{#if isedit}}
                <div class="preview_img">
                    <img bind-src="{{preview_img||'/images/public/08_avatar_small.jpg'}}?imageView2/1/w/48/h/48" />
                </div>
                <div class="method">
                    <a event-click="{{'$Top.$Event.admin.module.submit_edit'}}">提交</a>
                    <a event-click="{{'$Top.$Event.admin.module.edit_module'}}">取消</a>
                </div>
                <div class="title">
                    <input type="text" bind-input="{{'name'}}" bind-value="{{name}}" placeholder="请输入版块名称" />
                </div>
                {{#else}}
                <div class="preview_img">
                    <img bind-src="{{preview_img||'/images/public/08_avatar_small.jpg'}}?imageView2/1/w/48/h/48" />
                </div>
                <div class="method">
                    <a event-click="{{'$Top.$Event.admin.module.edit_module'}}">编辑</a>
                    <a event-click="{{'$Top.$Event.admin.module.delete_module'}}">删除</a>
                </div>
                <div class="title">
                    <a event-click="{{'$Top.$Event.admin.module.changeModule'}}">{{name}}</a>
                </div>
                {{/if}}
            </div>
            {{/each}}
            <div class="pagebox">
                <a class="button icon-angle-left" event-click="{{'$Event.admin.module.preModulePage'}}"></a>
                {{#each $Cache.admin.module.pages}}
                <href to="/admin/module.html?page={{$Index}}&num={{$Top.$Cache.admin.module.currentPageNum}}" class="{{($Top.$Cache.admin.module.currentPage==$Index)&&'focus'}}">{{$Index+1}}</href>
                {{/each}}
                <a class="button icon-angle-right" event-click="{{'$Event.admin.module.nextModulePage'}}"></a>
            </div>
            {{#else}}
            <div class="item">
                <div class="title">列表为空</div>
            </div>
            {{/if}}
        </div>
    </div>
    <div class="postbox">
        <div class="posttitle">
            <div class="item">
                <div class="title">{{$Cache.admin.module.selectedModule.name||"所有话题"}}</div>
            </div>
            <div class="item">
                关键字：
                <input class="text" type="text" placeholder="请输入搜索关键字" bind-input="{{'$Cache.admin.module.search_key'}}" bind-value="{{$Cache.admin.module.search_key}}" />
            </div>
            <div class="item">
                <button event-click="{{'$Event.admin.module.search'}}">搜索</button>
            </div>
        </div>
        <div class="posts">
            {{#if $Cache.admin.module.post_list.length}} {{#each $Cache.admin.module.post_list}}
            <div class="item">
                <div class="title">{{title}}</div>
                <div class="time">{{#Time createtime,"YYYY-MM-DD HH:mm:ss"}}，{{creater.name}}</div>
                <div class="method">
                    <a event-click="{{'$Top.$Event.admin.module.edit_post'}}">编辑</a>
                    <a event-click="{{'$Top.$Event.admin.module.delete_post'}}">删除</a>
                </div>
            </div>
            {{/each}}
            <div class="pagebox">
                <a class="button icon-angle-left" event-click="{{'$Event.admin.module.prePostPage'}}"></a>
                {{#each $Cache.admin.module.postPages}}
                <href to="/admin/module.html?page={{$Index}}&num={{$Top.$Cache.admin.module.currentPageNum}}" class="{{($Top.$Cache.admin.module.current_m_page==$Index)&&'focus'}}">{{$Index+1}}</href>
                {{/each}}
                <a class="button icon-angle-right" event-click="{{'$Event.admin.module.nextPostPage'}}"></a>
            </div>
            {{#else}}
            <div class="item">
                <div class="title">列表为空</div>
            </div>
            {{/if}}
        </div>
    </div>
</div>
